const http={
	default:{
		baseURL:'https://fc-mp-7795f0e1-109a-48b1-97ac-39e2ba151ab3.next.bspapp.com'
	},
	
	get(url,data,header){	
		url=this.default.baseURL+url
		header={...header}
		return new Promise((resolve,reject)=>{
		//获取本地token值
		const token = uni.getStorageSync('token') || {};
		uni.request({
		    url: url,
			method:'GET',
		    data:  {...data} || {},
		    header:{...header,'Authorization':'Bearer '+ token},
		    success: (res) => {
		       resolve(res)
		    }
		})
	})
	
	},
	
	post(url,data,header){
		url=this.default.baseURL+url
		header={...header}
		return new Promise((resolve,reject)=>{
			//获取本地token值
		const token = uni.getStorageSync('token') || {};
		uni.request({
		    url: url,
			method:'POST',
		    data: {...data} || {},
		    header:{...header,'Authorization':'Bearer '+ token},
		    success: (res) => {
				resolve(res)
		    }
		})
	})
	}
	
	
}

export default http